/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Carito
 */
@Embeddable
@XmlRootElement
public class TrmPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDTRM")
    private BigInteger idtrm;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDDATO")
    private BigInteger iddato;

    public TrmPK() {
    }

    public TrmPK(BigInteger idtrm, BigInteger iddato) {
        this.idtrm = idtrm;
        this.iddato = iddato;
    }

    @XmlAttribute
    public BigInteger getIdtrm() {
        return idtrm;
    }

    public void setIdtrm(BigInteger idtrm) {
        this.idtrm = idtrm;
    }

    @XmlAttribute
    public BigInteger getIddato() {
        return iddato;
    }

    public void setIddato(BigInteger iddato) {
        this.iddato = iddato;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtrm != null ? idtrm.hashCode() : 0);
        hash += (iddato != null ? iddato.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TrmPK)) {
            return false;
        }
        TrmPK other = (TrmPK) object;
        if ((this.idtrm == null && other.idtrm != null) || (this.idtrm != null && !this.idtrm.equals(other.idtrm))) {
            return false;
        }
        if ((this.iddato == null && other.iddato != null) || (this.iddato != null && !this.iddato.equals(other.iddato))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.TrmPK[ idtrm=" + idtrm + ", iddato=" + iddato + " ]";
    }
    
}
